package com.gxc.mq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author GongXincheng
 * @since 2019-08-23 10:03
 */
@Slf4j
@Component
public class Demo4_Privider {

    @Resource private AmqpTemplate amqpTemplate;

    public void send1() {
        System.out.println("send 1 has send message");
        amqpTemplate.convertAndSend("topicExchange", "topic.message", "Hi am Message_1");
    }

    public void send2() {
        System.out.println("send 2 has send message");
        amqpTemplate.convertAndSend("topicExchange", "topic.messages", "Hi am Message_2");
    }
}
